package com.helmlabs.grouper.accounts.dao;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.helmlabs.grouper.accounts.model.Company;

public class CompanyDaoHibernate extends HibernateDaoSupport implements CompanyDao {

	public Company get(Long id) {
		return (Company)getHibernateTemplate().get(Company.class, id);
	}

	public Company save(Company company) {
		if (company!=null && company.getId()==null){
			Long id = (Long)getHibernateTemplate().save(company);
			company.setId(id);
		} else if (company!=null){
			getHibernateTemplate().save(company);
		}
		return company;
	}

	public Company getCurrentCompanyByUserId(Long userid) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Company> getPage(int page, int pageSize, String sort, String dir) {
		// TODO Auto-generated method stub
		return null;
	}
	


}
